//    Copyright (C) 2013  <lugocreation@gmail.com>
//
//    This program is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with this program.  If not, see <http://www.gnu.org/licenses/>.
package org.jpgolay.me.util;

import java.io.Serializable;
import javax.swing.JDesktopPane;
import org.jpgolay.me.user.User;

public class Parameter
        implements Serializable {

    public Parameter() {
    }

    public Parameter(Integer minimumDecimalNumber, String accessLaw, String parameter1, String parameter2, String parameter3, Integer roundType, String printCustomerQuoteLaw,
            String printCustomerOrderLaw, String printCustomerDeliveryLaw, String printCustomerBillLaw, String printCustomerAssetLaw, String printSupplierOrderLaw, String printSupplierBillLaw, String printSupplierAssetLaw,
            User user, JDesktopPane desktop, String minimumProfitMargin) {
        setMinimumDecimalNumber(minimumDecimalNumber);
        setAccessLaw(accessLaw);
        setParameter1(parameter1);
        setParameter2(parameter2);
        setParameter3(parameter3);
        setRoundType(roundType);
        setMinimumProfitMargin(minimumProfitMargin);
        setPrintCustomerQuoteLaw(printCustomerQuoteLaw);
        setPrintCustomerOrderLaw(printCustomerOrderLaw);
        setPrintCustomerDeliveryLaw(printCustomerDeliveryLaw);
        setPrintCustomerBillLaw(printCustomerBillLaw);
        setPrintCustomerAssetLaw(printCustomerAssetLaw);
        setPrintSupplierOrderLaw(printSupplierOrderLaw);
        setPrintSupplierBillLaw(printSupplierBillLaw);
        setPrintSupplierAssetLaw(printSupplierAssetLaw);
        setUser(user);
        setDesktop(desktop);
    }

    public Parameter(Parameter otherData) {
        setMinimumDecimalNumber(otherData.getMinimumDecimalNumber());
        setAccessLaw(otherData.getAccessLaw());
        setParameter1(otherData.getParameter1());
        setParameter2(otherData.getParameter2());
        setParameter3(otherData.getParameter3());
        setRoundType(otherData.getRoundType());
        setMinimumProfitMargin(otherData.getMinimumProfitMargin());
        setPrintCustomerQuoteLaw(otherData.getPrintCustomerQuoteLaw());
        setPrintCustomerOrderLaw(otherData.getPrintCustomerOrderLaw());
        setPrintCustomerDeliveryLaw(otherData.getPrintCustomerDeliveryLaw());
        setPrintCustomerBillLaw(otherData.getPrintCustomerBillLaw());
        setPrintCustomerAssetLaw(otherData.getPrintCustomerAssetLaw());
        setPrintSupplierOrderLaw(otherData.getPrintSupplierOrderLaw());
        setPrintSupplierBillLaw(otherData.getPrintSupplierBillLaw());
        setPrintSupplierAssetLaw(otherData.getPrintSupplierAssetLaw());
        setUser(otherData.getUser());
        setDesktop(otherData.getDesktop());
    }

    public String getUserId() {
        return user.getId();
    }

    public void setMinimumDecimalNumber(Integer minimumDecimalNumber) {
        this.minimumDecimalNumber = minimumDecimalNumber;
    }

    public Integer getMinimumDecimalNumber() {
        return minimumDecimalNumber;
    }

    public void setAccessLaw(String accessLaw) {
        this.accessLaw = accessLaw;
    }

    public String getAccessLaw() {
        return accessLaw;
    }

    public void setParameter1(String parameter1) {
        this.parameter1 = parameter1;
    }

    public String getParameter1() {
        return parameter1;
    }

    public void setParameter2(String parameter2) {
        this.parameter2 = parameter2;
    }

    public String getParameter2() {
        return parameter2;
    }

    public void setParameter3(String parameter3) {
        this.parameter3 = parameter3;
    }

    public String getParameter3() {
        return parameter3;
    }

    public void setRoundType(Integer roundType) {
        this.roundType = roundType;
    }

    public Integer getRoundType() {
        return roundType;
    }

    public void setMinimumProfitMargin(String minimumProfitMargin) {
        this.minimumProfitMargin = minimumProfitMargin;
    }

    public String getMinimumProfitMargin() {
        return minimumProfitMargin;
    }

    public String getPrintCustomerAssetLaw() {
        return printCustomerAssetLaw;
    }

    public void setPrintCustomerAssetLaw(String printCustomerAssetLaw) {
        this.printCustomerAssetLaw = printCustomerAssetLaw;
    }

    public String getPrintCustomerBillLaw() {
        return printCustomerBillLaw;
    }

    public void setPrintCustomerBillLaw(String printCustomerBillLaw) {
        this.printCustomerBillLaw = printCustomerBillLaw;
    }

    public String getPrintCustomerDeliveryLaw() {
        return printCustomerDeliveryLaw;
    }

    public void setPrintCustomerDeliveryLaw(String printCustomerDeliveryLaw) {
        this.printCustomerDeliveryLaw = printCustomerDeliveryLaw;
    }

    public String getPrintCustomerOrderLaw() {
        return printCustomerOrderLaw;
    }

    public void setPrintCustomerOrderLaw(String printCustomerOrderLaw) {
        this.printCustomerOrderLaw = printCustomerOrderLaw;
    }

    public String getPrintCustomerQuoteLaw() {
        return printCustomerQuoteLaw;
    }

    public void setPrintCustomerQuoteLaw(String printCustomerQuoteLaw) {
        this.printCustomerQuoteLaw = printCustomerQuoteLaw;
    }

    public String getPrintSupplierAssetLaw() {
        return printSupplierAssetLaw;
    }

    public void setPrintSupplierAssetLaw(String printSupplierAssetLaw) {
        this.printSupplierAssetLaw = printSupplierAssetLaw;
    }

    public String getPrintSupplierBillLaw() {
        return printSupplierBillLaw;
    }

    public void setPrintSupplierBillLaw(String printSupplierBillLaw) {
        this.printSupplierBillLaw = printSupplierBillLaw;
    }

    public String getPrintSupplierOrderLaw() {
        return printSupplierOrderLaw;
    }

    public void setPrintSupplierOrderLaw(String printSupplierOrderLaw) {
        this.printSupplierOrderLaw = printSupplierOrderLaw;
    }

    public JDesktopPane getDesktop() {
        return desktop;
    }

    public void setDesktop(JDesktopPane desktop) {
        this.desktop = desktop;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public String toString() {
        StringBuffer str = new StringBuffer("{");
        str.append("userId=" + getUserId() + " " + "minimumDecimalNumber=" + getMinimumDecimalNumber() + " " + "accessLaw=" + getAccessLaw() + " " + "parameter1=" + getParameter1() + " " + "parameter2=" + getParameter2() + " " + "parameter3=" + getParameter3() + " " + "roundType=" + getRoundType() + " " + "printCustomerQuoteLaw=" + getPrintCustomerQuoteLaw() + " " + "printCustomerOrderLaw=" + getPrintCustomerOrderLaw() + " " + "printCustomerDeliveryLaw=" + getPrintCustomerDeliveryLaw() + " " + "printCustomerBillLaw=" + getPrintCustomerBillLaw() + " " + "printCustomerAssetLaw=" + getPrintCustomerAssetLaw() + " " + "printSupplierOrderLaw=" + getPrintSupplierOrderLaw() + " " + "printSupplierBillLaw=" + getPrintSupplierBillLaw() + " " + "printSupplierAssetLaw=" + getPrintSupplierAssetLaw() + " " + "user=" + getUser() + " " + "desktop=" + getDesktop() + " " + "minimumProfitMargin=" + getMinimumProfitMargin());
        str.append('}');
        return str.toString();
    }

    public boolean equals(Object pOther) {
        if (pOther instanceof Parameter) {
            Parameter lTest = (Parameter) pOther;
            boolean lEquals = true;
            if (userId == null) {
                lEquals = lEquals && lTest.userId == null;
            } else {
                lEquals = lEquals && userId.equals(lTest.userId);
            }
            if (minimumDecimalNumber == null) {
                lEquals = lEquals && lTest.minimumDecimalNumber == null;
            } else {
                lEquals = lEquals && minimumDecimalNumber.equals(lTest.minimumDecimalNumber);
            }
            if (accessLaw == null) {
                lEquals = lEquals && lTest.accessLaw == null;
            } else {
                lEquals = lEquals && accessLaw.equals(lTest.accessLaw);
            }
            if (parameter1 == null) {
                lEquals = lEquals && lTest.parameter1 == null;
            } else {
                lEquals = lEquals && parameter1.equals(lTest.parameter1);
            }
            if (parameter2 == null) {
                lEquals = lEquals && lTest.parameter2 == null;
            } else {
                lEquals = lEquals && parameter2.equals(lTest.parameter2);
            }
            if (parameter3 == null) {
                lEquals = lEquals && lTest.parameter3 == null;
            } else {
                lEquals = lEquals && parameter3.equals(lTest.parameter3);
            }
            if (roundType == null) {
                lEquals = lEquals && lTest.roundType == null;
            } else {
                lEquals = lEquals && roundType.equals(lTest.roundType);
            }
            if (minimumProfitMargin == null) {
                lEquals = lEquals && lTest.minimumProfitMargin == null;
            } else {
                lEquals = lEquals && minimumProfitMargin.equals(lTest.minimumProfitMargin);
            }
            if (printCustomerQuoteLaw == null) {
                lEquals = lEquals && lTest.printCustomerQuoteLaw == null;
            } else {
                lEquals = lEquals && printCustomerQuoteLaw.equals(lTest.printCustomerQuoteLaw);
            }
            if (printCustomerOrderLaw == null) {
                lEquals = lEquals && lTest.printCustomerOrderLaw == null;
            } else {
                lEquals = lEquals && printCustomerOrderLaw.equals(lTest.printCustomerOrderLaw);
            }
            if (printCustomerDeliveryLaw == null) {
                lEquals = lEquals && lTest.printCustomerDeliveryLaw == null;
            } else {
                lEquals = lEquals && printCustomerDeliveryLaw.equals(lTest.printCustomerDeliveryLaw);
            }
            if (printCustomerBillLaw == null) {
                lEquals = lEquals && lTest.printCustomerBillLaw == null;
            } else {
                lEquals = lEquals && printCustomerBillLaw.equals(lTest.printCustomerBillLaw);
            }
            if (printCustomerAssetLaw == null) {
                lEquals = lEquals && lTest.printCustomerAssetLaw == null;
            } else {
                lEquals = lEquals && printCustomerAssetLaw.equals(lTest.printCustomerAssetLaw);
            }
            if (printSupplierOrderLaw == null) {
                lEquals = lEquals && lTest.printSupplierOrderLaw == null;
            } else {
                lEquals = lEquals && printSupplierOrderLaw.equals(lTest.printSupplierOrderLaw);
            }
            if (printSupplierBillLaw == null) {
                lEquals = lEquals && lTest.printSupplierBillLaw == null;
            } else {
                lEquals = lEquals && printSupplierBillLaw.equals(lTest.printSupplierBillLaw);
            }
            if (printSupplierAssetLaw == null) {
                lEquals = lEquals && lTest.printSupplierAssetLaw == null;
            } else {
                lEquals = lEquals && printSupplierAssetLaw.equals(lTest.printSupplierAssetLaw);
            }
            if (user == null) {
                lEquals = lEquals && lTest.user == null;
            } else {
                lEquals = lEquals && user.equals(lTest.user);
            }
            if (desktop == null) {
                lEquals = lEquals && lTest.desktop == null;
            } else {
                lEquals = lEquals && desktop.equals(lTest.desktop);
            }
            return lEquals;
        } else {
            return false;
        }
    }

    public int hashCode() {
        int result = 17;
        result = 37 * result + (userId == null ? 0 : userId.hashCode());
        result = 37 * result + (minimumDecimalNumber == null ? 0 : minimumDecimalNumber.hashCode());
        result = 37 * result + (accessLaw == null ? 0 : accessLaw.hashCode());
        result = 37 * result + (parameter1 == null ? 0 : parameter1.hashCode());
        result = 37 * result + (parameter2 == null ? 0 : parameter2.hashCode());
        result = 37 * result + (parameter3 == null ? 0 : parameter3.hashCode());
        result = 37 * result + (roundType == null ? 0 : roundType.hashCode());
        result = 37 * result + (minimumProfitMargin == null ? 0 : minimumProfitMargin.hashCode());
        result = 37 * result + (printCustomerQuoteLaw == null ? 0 : printCustomerQuoteLaw.hashCode());
        result = 37 * result + (printCustomerOrderLaw == null ? 0 : printCustomerOrderLaw.hashCode());
        result = 37 * result + (printCustomerDeliveryLaw == null ? 0 : printCustomerDeliveryLaw.hashCode());
        result = 37 * result + (printCustomerBillLaw == null ? 0 : printCustomerBillLaw.hashCode());
        result = 37 * result + (printCustomerAssetLaw == null ? 0 : printCustomerAssetLaw.hashCode());
        result = 37 * result + (printSupplierOrderLaw == null ? 0 : printSupplierOrderLaw.hashCode());
        result = 37 * result + (printSupplierBillLaw == null ? 0 : printSupplierBillLaw.hashCode());
        result = 37 * result + (printSupplierAssetLaw == null ? 0 : printSupplierAssetLaw.hashCode());
        result = 37 * result + (user == null ? 0 : user.hashCode());
        result = 37 * result + (desktop == null ? 0 : desktop.hashCode());
        return result;
    }
    private String userId;
    private Integer minimumDecimalNumber;
    private String accessLaw;
    private String parameter1;
    private String parameter2;
    private String parameter3;
    private Integer roundType;
    private String minimumProfitMargin;
    private String printCustomerQuoteLaw;
    private String printCustomerOrderLaw;
    private String printCustomerDeliveryLaw;
    private String printCustomerBillLaw;
    private String printCustomerAssetLaw;
    private String printSupplierOrderLaw;
    private String printSupplierBillLaw;
    private String printSupplierAssetLaw;
    private User user;
    private JDesktopPane desktop;
}
